import 'package:seedfour/generated/json/base/json_field.dart';
import 'package:seedfour/generated/json/notice_v2_entity.g.dart';
import 'dart:convert';
export 'package:seedfour/generated/json/notice_v2_entity.g.dart';

@JsonSerializable()
class NoticeV2Entity {
  int? createdAt;
  int? updatedAt;
  int? id;
  String? uid;
  String? orgId;
  String? name;
  String? target;
  int? type;
  int? shareType;
  int? quota;
  int? needQuota;
  String? title;
  String? content;
  String? phoneNumber;
  String? subjectAmount;
  String? servicePrice;
  int? refreshAt;
  int? status;
  String? catalog;
  int? cooperRatio;
  String? ownerMobile;
  int? ownerType;
  String? receiveUid;
  String? receiveName;
  int? receiveTime;
  String? receivePhone;
  String? caseId;
  String? caseName;
  int? ownerContact;
  bool? isOwner;
  bool? isTaker;
  bool? isMan;
  List<NoticeV2Attaches>? attaches;
  List<NoticeV2History>? history;

  NoticeV2Entity();

  factory NoticeV2Entity.fromJson(Map<String, dynamic> json) =>
      $NoticeV2EntityFromJson(json);

  Map<String, dynamic> toJson() => $NoticeV2EntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class NoticeV2Attaches {
  String? name;
  String? url;

  NoticeV2Attaches({this.name, this.url});

  factory NoticeV2Attaches.fromJson(Map<String, dynamic> json) =>
      $NoticeV2AttachesFromJson(json);

  Map<String, dynamic> toJson() => $NoticeV2AttachesToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class NoticeV2History {
  int? createdAt;
  int? updatedAt;
  int? id;
  String? orgId;
  int? noticeId;
  String? caseId;
  String? caseName;
  String? uid;
  int? type;
  String? name;
  int? quota;
  String? remark;

  NoticeV2History();

  factory NoticeV2History.fromJson(Map<String, dynamic> json) =>
      $NoticeV2HistoryFromJson(json);

  Map<String, dynamic> toJson() => $NoticeV2HistoryToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
